<template>
  <div>
    <el-table
      :data="logData"
      style="width: 100%; margin-bottom: 20px"
      row-key="id"
      border
      default-expand-all
    >
      <el-table-column prop="username" label="登入账户" />
      <el-table-column prop="lastLogin.ip" label="上次登入ip"/>
      <el-table-column prop="lastLogin.loginTime" label="上次登入时间" sortable />
      <el-table-column prop="nowLogin.ip" label="本次登入ip" />
      <el-table-column prop="nowLogin.loginTime" label="本次登入时间"/>
    </el-table>
  </div>
</template>
<script setup>
//引入请求的接口
import * as api from "@/api/users"
import {ref,onBeforeMount} from "vue"
//日志数据
let logData=ref([])
onBeforeMount(async()=>{
  //发起请求获取日志数据
  try{
     let res=await api.getLoginLogApi()
     logData.value=res.data.data;
     console.log(res)
  }catch(e){
    console.log(e)
  }
})
</script>
<script>
export default {
  meta:{title: 'glsy', 
  name: '管理首页',
  routeName:"welcome",
  icon:"icon-shouye"}
}
</script>
